//
//  ChannelCollectionViewCell.m
//  CapriceMusic
//
//  Created by dllo on 16/1/9.
//  Copyright © 2016年 MYX. All rights reserved.
//

#import "ChannelCollectionViewCell.h"

@implementation ChannelCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.channelImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self addSubview:self.channelImageView];
        
        self.addView = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.addView.image = [UIImage imageNamed:@"Jianbian"];
        [self addSubview:self.addView];
        
        self.channelLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        self.channelLabel.font = [UIFont systemFontOfSize:14];
        self.channelLabel.textColor = [UIColor whiteColor];
        [self addSubview:self.channelLabel];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    self.channelImageView.frame = CGRectMake(0, 0, self.frame.size.width - 2, self.frame.size.height - 2);
    self.channelLabel.frame = CGRectMake(20, self.frame.size.height - 30, 130, 20);
    self.addView.frame = self.bounds;
}

@end
